<template>
    <div>
        <h3>-----------组件深度传值---------------</h3>
        <sonComp></sonComp>
    </div>
</template>

<script>
import { inject, provide } from "vue"
import sonComp from "./son.vue"
export default {
    setup() {
        // 获取在main.js传递的token值
        let token = inject('token')
        console.log(token)

        // 使用provide传值
        provide('data', [1, 2, 3, 4, 5])
    },
    components: {
        sonComp
    }
};
</script>

<style scoped></style>
